/* 分组管理 */
import httpRequest from '@/utils/httpRequest'
// 新增修改分组
export function editGroup (data) {
  return httpRequest({
    url: '/truck/truckGroup/save',
    method: 'post',
    data: data
  })
}

// 获取分组列表
export function getGroupList (params) {
  return httpRequest({
    url: '/truck/truckGroup/list',
    method: 'get',
    params: params
  })
}

// 获取分组列表(不带分页)
export function getGroupListAll (params) {
  return httpRequest({
    url: '/truck/truckGroup/allList',
    method: 'get',
    params: params
  })
}
// 修改分组状态
export function modifyState (params) {
  return httpRequest({
    url: '/truck/truckGroup/modify-state',
    method: 'post',
    data: params,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}
// 获取车辆分组树
export function getTreeData (data) {
  return httpRequest({
    url: '/truck/truckGroup/treeData',
    method: 'get',
    params: data
  })
}
//车辆分组属性列表
export function getGroupProperty (data) {
  return httpRequest({
    url: '/truck/truckGroupExtend/list',
    method: 'get',
    params: data
  })
}
//获取全部车辆分组属性列表
export function getVarByModularId (data) {
  return httpRequest({
    url: '/var/getVarByModularId',
    method: 'get',
    params: data
  })
}
//添加车辆分组属性
export function save (data) {
  return httpRequest({
    url: '/truck/truckGroupExtend/save',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}
//车辆分组属性删除
export function deleteProp (data) {
  return httpRequest({
    url: '/truck/truckGroupExtend/delete',
    method: 'delete',
    params: data
  })
}
//查询车辆
export function getCarList (data) {
  return httpRequest({
    url: '/truck/truck/list',
    method: 'get',
    params: data
  })
}
//保存某个组已选择的车辆
export function selectCar (data) {
  return httpRequest({
    url: '/truck/truck/setListByGroup',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}
//根据分组查询车辆外面需要的
export function getCarListByGroup (data) {
  return httpRequest({
    url: '/truck/truckGroupRelation/list',
    method: 'get',
    params: data
  })
}

